home *** CD-ROM | disk | FTP | other *** search
- Glydo.RecommendationViewClassesMap = Prototype.Class.create({
- initialize: function(table) {
- this.table = table;
- },
-
- internalLookup: function(rec) {
- var res = this.table[rec.contentType];
- if (Prototype.O.isFunction(res)) {
- return res.call(rec);
- } else {
- return res;
- }
- },
-
- lookup: function(rec) {
- var res = this.internalLookup(rec);
- if (res) {
- return res.className || "glydo-default";
- }
- return "glydo-default";
- },
-
- nStyles: function(rec) {
- var res = this.internalLookup(rec);
- if (res) {
- return res.nStyles || 1;
- }
- return 1;
- }
- });
-
- Glydo.RECOMMENDATION_VIEW_CLASSES_MAP = new Glydo.RecommendationViewClassesMap({
- "info": {
- className: "glydo-info",
- nStyles: 1
- },
- "review": {
- className: "glydo-review",
- nStyles: 1
- },
- "twitter": {
- className: "glydo-twitter",
- nStyles: 3
- },
- "rss": {
- className: "glydo-rss",
- nStyles: 1
- },
- "other": {
- className: "glydo-other",
- nStyles: 1
- },
- "news": {
- className: "glydo-news",
- nStyles: 1
- },
- "video": {
- className: "glydo-video",
- nStyles: 1
- },
- "product": function() {
- if (this.contextRelation == "same_product_alternative_offer") {
- return ({
- className: "glydo-store-offer",
- nStyles: 1
- });
- }
- if (this.contextRelation == "ad") {
- return ({
- className: "glydo-product-ad",
- nStyles: 1
- });
- }
- return ({
- className: "glydo-product-ad",
- nStyles: 1
- });
- },
- "ad": {
- className: "glydo-ad",
- nStyles: 1
- }
- });
-
-